<template>
  <div class="home">
    home page
    <div>
      <el-button @click="sendGet()">GET</el-button>
      <el-button @click="sendPost()">POST</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Home',
  methods: {
    async sendGet() {
      const { data: res } = await this.$http.get('/user/list')
      console.log(res)
    },
    async sendPost() {
      const { data: res } = await this.$http.post('/user', {
        name: 'zs',
        age: 18,
        sex: '男'
      })
      console.log(res)
    }
  },
  mounted() {
    console.log('mounted...')
  },
  created() {
    console.log('hehe')
  }
}
</script>
